<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/11/11
 * Time: 10:28
 */
namespace Admin\Model;
use Base\Model\BaseModel;
class TroubleDetailModel extends BaseModel {
    protected $dbName = 'transplant_manager0';
    protected $_link=array(
        'patientinfo' => array(
            'mapping_type' => self::BELONGS_TO  ,
            'class_name'    => 'transplant_userinformation.patient_info',
            'foreign_key' => 'userid',
            'parent_key' => 'id',
            'mapping_fields' => 'realname'
//            'as_fields'=>'patientinfo'
        ) ,
        'troubleinfo' => array(
            'mapping_type' => self::BELONGS_TO  ,
            'class_name'    => 'troubleinfo',
            'foreign_key' => 'troubleid',
            'parent_key' => 'id',
           'mapping_fields' =>'name'
          // 'as_fields'=>'troubleinfo'
        )  ,
        'durationinfo' => array(
            'mapping_type' => self::BELONGS_TO  ,
            'class_name'    => 'durationinfo',
            'foreign_key' => 'durationid',
            'parent_key' => 'id',
          //  'as_fields'=>'durationinfo'
        'mapping_fields' =>'name'
        )
    );
}